<?php

require $this->website['path']['action'].'/admin/isadmin.php';


$json = array('status'=>'error','msg'=>'error','data'=>'');
$id = fn_post('id');
$admin = fn_session('admin');

if($admin['id'] == $id){
  $json['msg'] = 'id';
  $json['data']= '不能删除自己';
}elseif(!$id || !is_numeric($id)){
  $json['msg'] = 'id';
  $json['data']= '错误参数';
}elseif(!$this->website['class']['db']->table('user_merchant')->where('id=?',$id)->count()){
  $json['msg'] = 'id';
  $json['data']= '未知的用户';
}else{
  $this->website['class']['db']->table('user_merchant')->where('id=?',$id)->limit(1)->delete();
  $json['msg'] = 'ok';
  $json['status']= 'ok';
  $json['data'] = '删除成功!';
}

echo json_encode($json);